Here's a serious answer: randomness > ties. This is a competition site, and if ring attack gets dumbed down to collecting all rings in a stage, while taking as much time as you want, it's not competition. With randomness, you actually have to do the stage many times, and the one who comes on top is, most of the time, the one who showed the most perseverance, getting better and faster every time, hopefully finding tricks for score attack in the process.
And since you want logic: A ? box simply does not always give you the best result. Reality > Imagination. It will and probably is interesting for other people to see what amount of rings, and luck, we've been able to get through stages with these boxes. It won't if they just become representations of what we could get if the game was just being perfect for us.
Games with ? boxes are practically the only ones interesting to ring attack. If you remove them, ring attack just becomes more useless, except for noobs who want to get better points easily. Look at stages such as Gamma's Final Egg. That not cool.